package com.shop.admin.dao.store;

import com.shop.jpa.BaseDao;
import com.shop.domain.store.StoreOrder;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface StoreOrderDao extends BaseDao<StoreOrder, Long> {

    @Query(nativeQuery = true,value = "select o.* from t_store_order o where `pay_code` > 0 and pay_status = 0 and `status` = 0 and `create_time` > ?1 and `create_time` < ?3 order by id asc limit ?2")
    List<StoreOrder> findNeedPayList(Date beginTime, int limit, Date endTime);
}
